<?php

/**
 * This class manages roles and resources used for access control.
 */
class Fkb_Acl extends Zend_Acl
{

    /**
     * Initialize roles.
     */
    public function __construct()
    {
        $roles = array(
	    'guest' => null,
	    'user' => array('guest'), 
	    'admin' => array('guest', 'user'));
	
        $this->addRoles($roles);
    }

    /**
     * Adds roles to Zend_Acl base class.
     * 
     * @param array $roles the roles to be added.
     */
    private function addRoles($roles)
    {
        foreach ($roles as $name => $parents) {
            $this->addRole(new Zend_Acl_Role($name), $parents);
        }
    }

}